import request from '@/utils/request'

// api地址
const api = {
	getCategoryList:"/api/category.category/getCategoryList",
	getIndexNotice:"/api/Index/getIndexNotice",
	getHotProduct:"/api/index/getHotProduct",
	homefloating:'/api/user/homefloating',
	carouselchart:'/api/user/carouselchart'
}

// 卡券展示
export const getCategoryList = param => {
  return request.get(api.getCategoryList, param )
}
// 公告
export const getIndexNotice = param => {
  return request.get(api.getIndexNotice, param )
}
// 热门
export const getHotProduct = param => {
	let str = api.getHotProduct
	if(param.s){
		str = api.getHotProduct + '/s=/'+param.s
	}
	delete param.s
  return request.get(str, param )
}
// 页面浮窗
export const homefloating = param => {
  return request.get(api.homefloating, param )
}
// 首页轮播图
export const carouselchart = param => {
  return request.get(api.carouselchart, param )
}